package ca.newcommerce.youtube.data
{

    public class CategoryData extends AbstractData
    {
        protected var _data:Object;

        public function CategoryData(param1:Object)
        {
            this._data = param1;
            return;
        }// end function

        public function get label() : String
        {
            return this._data.label;
        }// end function

        public function get scheme() : String
        {
            var _loc_1:* = fromObj(this._data, "scheme");
            if (_loc_1.indexOf("#") != -1)
            {
                return _loc_1.substr((_loc_1.indexOf("#") + 1));
            }
            return _loc_1.substr((_loc_1.lastIndexOf("/") + 1), _loc_1.lastIndexOf(".") - (_loc_1.lastIndexOf("/") + 1));
        }// end function

        public function get term() : String
        {
            var _loc_1:* = fromObj(this._data, "term");
            if (_loc_1.indexOf("#") != -1)
            {
                return _loc_1.substr((_loc_1.lastIndexOf("#") + 1));
            }
            return _loc_1;
        }// end function

        public function get text() : String
        {
            return this._data.$t != "" ? (this._data.$t) : (this._data.label != "" ? (this.label) : (this.term));
        }// end function

    }
}
